package com.usian.article.controller;

import com.usian.apis.article.ApArticleConfigControllerApi;
import com.usian.apis.article.ApArticleControllerApi;
import com.usian.article.service.impl.ApArticleConfigServiceImpl;
import com.usian.model.article.pojos.ApArticleConfig;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.common.enums.AppHttpCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/article_config")
public class ApArticleConfigController implements ApArticleConfigControllerApi {
    @Autowired
    private ApArticleConfigServiceImpl apArticleConfigService;

    /**
     * 保存文章自动审核表
     * @param apArticleConfig
     * @return
     */
    @PostMapping("/save")
    @Override
    public ResponseResult saveArticleConfig(@RequestBody ApArticleConfig apArticleConfig) {
        boolean b = apArticleConfigService.save(apArticleConfig);
        return b?ResponseResult.okResult(AppHttpCodeEnum.SUCCESS):ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR);
    }
}
